<?php
class Goods{
    public function do($file){
        $image = $file['root_path'].$data['savepath'].$data['savename'];
        $model = new ConfigModel;
        $baisc = $model->getBasic();
        $is_water_mark = $basic['watermark_dimension'];
        $show = $model->getShow();
        $thumb = [
            $show['thumb_width'],
            $show['thumb_height']
        ];
        $default = [
            $show['image_width'],
            $show['image_height']
        ];
        if(!empty(thumb)){
            $thumb_image = $this->thumb($file['src'],$show['thumb_width'], $show['image_height']);
            $this->waterMark($thumb);
        }else{
            $this->waterMark($thumb);
        }
        if(!empty($default)){
            $new_image = $this->thumb($file['src'],$default['image_width'], $default['image_height']);
            if(empty($is_water_mark)){
                $thumb_image = $this->thumb($file['src'],$show['thumb_width'], $show['image_height']);
            }else{
                $this->waterMark($thumb_image);
            }
        }
    }
    
}